package com.ipinyou.hb2hf

import org.apache.spark.SparkConf
import org.apache.spark.SparkContext
import com.ipinyou.hbase.model.MUser
import com.ipinyou.hbase.service.impl.HBaseConnectionServiceImpl
import org.slf4j.LoggerFactory
import org.apache.hadoop.hbase.HBaseConfiguration
import org.apache.hadoop.hbase.mapreduce.TableInputFormat
import org.apache.hadoop.hbase.util.Bytes
import scala.collection.mutable.ArrayBuffer
import org.apache.spark.SparkFiles

object CountTest {

  val a = 1.0
  val b = 2.0

  // 0 测试, 1 正式
  var flag = "0"

  var output = "file:///Users/miaoyujia/tmp/hb2hdfs"
  var all_rule = "/Users/miaoyujia/tmp/aa"
  // log
  val log = LoggerFactory.getLogger(this.getClass)

  def main(args: Array[String]): Unit = {

    if (args.length > 0) {
      flag = args(0)
      output = args(1)
      all_rule = args(2)
    }

    val config = new SparkConf().setAppName("mobile.catecount")
    val sc = new SparkContext(config)

    // 和中文匹配
//    sc.addFile(all_rule)
    sc.textFile(SparkFiles.get(all_rule)).collect

  }
}